#-*-coding:UTF-8-*-

import os.path

from tornado import template

from ..logger import logger
from ..config import PLATMGT_HOME, get_property

URL_PREFIX = '/%s'%get_property('url.prefix', '/platmgt').strip('/') # default: /platmgt

APP_PREFIX = '/%s'%get_property('app.prefix', '').strip('/') # default: '' or /app

if APP_PREFIX == '/':
    APP_PREFIX = ''

HTML_URL_BASE = URL_PREFIX + APP_PREFIX

LOCAL_STATIC_BASE = os.path.join(PLATMGT_HOME, 'templates', get_property('app.prefix', '').strip('/'))

LOCAL_HTML_BASE   = os.path.join(PLATMGT_HOME, 'templates', get_property('app.prefix', '').strip('/'), 'pages')

LOCAL_HTML_TEMP_BASE = os.path.join(PLATMGT_HOME, 'templates', 'adminlte')


#URL_MAPPING = []

HOME_URL      = '%s/pages/home'%HTML_URL_BASE

LOGIN_URL     = '%s/pages/login'%HTML_URL_BASE

LOGOUT_URL    = '%s/pages/logout'%HTML_URL_BASE

NOT_FOUND_URL = '%s/pages/404'%HTML_URL_BASE

ERROR_URL     = '%s/pages/error'%HTML_URL_BASE




logger.debug('platmgt.web.props module init')
logger.debug('URL_PREFIX      = %s'%URL_PREFIX)
logger.debug('APP_PREFIX      = %s'%APP_PREFIX)
logger.debug('LOCAL_HTML_BASE = %s'%LOCAL_HTML_BASE)

